#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>


bool MainWindow::connectActions(){

        closeAct = new QAction(tr("Cl&ose"), this);
        closeAct->setStatusTip(tr("Close the active window"));
        connect(closeAct, SIGNAL(triggered()),
                mdiArea, SLOT(closeActiveSubWindow()));


        closeAllAct = new QAction(tr("Close &All"), this);
        closeAllAct->setStatusTip(tr("Close all the windows"));
        connect(closeAllAct, SIGNAL(triggered()),
                mdiArea, SLOT(closeAllSubWindows()));

        tileAct = new QAction(tr("&Tile"), this);
        tileAct->setStatusTip(tr("Tile the windows"));
        connect(tileAct, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows()));

        cascadeAct = new QAction(tr("&Cascade"), this);
        cascadeAct->setStatusTip(tr("Cascade the windows"));
        connect(cascadeAct, SIGNAL(triggered()), mdiArea, SLOT(cascadeSubWindows()));

        nextAct = new QAction(tr("Ne&xt"), this);
        nextAct->setShortcuts(QKeySequence::NextChild);
        nextAct->setStatusTip(tr("Move the focus to the next window"));
        connect(nextAct, SIGNAL(triggered()),
                mdiArea, SLOT(activateNextSubWindow()));

        previousAct = new QAction(tr("Pre&vious"), this);
        previousAct->setShortcuts(QKeySequence::PreviousChild);
        previousAct->setStatusTip(tr("Move the focus to the previous "
                                     "window"));
        connect(previousAct, SIGNAL(triggered()),
                mdiArea, SLOT(activatePreviousSubWindow()));

        separatorAct = new QAction(this);
        separatorAct->setSeparator(true);



        aboutQtAct = new QAction(tr("About &Qt"), this);
        aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
        connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));

    return true;
}


